<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		.well p{
			text-indent:2em;
			font-size:14px;
			line-height:1.5;
			overflow:hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.well small{
			float:right;
		}
		.well .right{
		float:right;
		margin:5px;
		}
	</style>
  </head>
  
  <body>
    <%@ include file="top.jsp" %>
    <div class="container" style="margin-top:50px;">
		<div class="row">
			<div class="span3">
				<div class="well" style="padding:10px 0;margin-top:20px;">
					<ul class="nav nav-list">
					  <li class="nav-header">${sessionScope.pu.project.name}</li>
					  <li >${sessionScope.user.username }:${sessionScope.pu.role}</li>
					  <li class="divider"></li>
					  <li ><a href="project.jspx?id=${pu.projectid }"><i class="icon-home"></i>最新动态</a></li>
					  <li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
					  <li class="active"><a href="document.jspx"><i class="icon-folder-open icon-white"></i>资料库</a></li>
					  <li><a href="file.jspx"><i class="icon-file"></i>文件共享</a></li>
					  <li><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>
					  <li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
					  <li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
					  <li><a href="main.jspx?m=editProject&id=${pu.projectid }"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
			</div>
			<div class="span9">
				<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:45px;border-bottom:none;">
					<li >
						<a href="document.jspx"><i class="icon-folder-open"></i>资料</a>
					</li>
					<li class="pull-right">
						<i class="icon-plus"></i>
						<a href="document.jspx?m=addDocu" class="link-black">分享新资料</a>
					</li>
				</ul>
				<div class="well" style="border-radius:0px;border-top:none;min-height:300px" >
					<c:choose>
						<c:when test="${fn:length(list) == 0}">
							<div style="color:red;font-size:16px">
								这里还没有任何资料，赶紧来分享您的资料的！
							</div>
						</c:when>
						<c:otherwise>
								<c:forEach items="${page.result }" var = "d">
						<blockquote>
						<h4><a href="document.jspx?m=show&p=${page.pageNum }&id=${d.id }">${d.name }</a></h4>
						<p>${d.cont}</p>
						<small>${d.user.username}：发布于  ${d.time}</small><br>
						<a href="document.jspx?m=del&id=${d.id }" title="删除" class="right"><i class="icon-trash"></i></a>
						<a href="document.jspx?m=edit&id=${d.id }" title="编辑" class="right"><i class="icon-pencil"></i></a>					
						</blockquote>
					</c:forEach> 
					<br><br>
					<div class="pagination pagination-right">
						<ul>
							<c:choose>
						  		<c:when test="${page.pageNum == 1 }">
						  			<li><a>首页</a></li>
						  		</c:when>
						  		<c:otherwise>
								  	<li><a href="document.jspx?p=1">首页</a></li>
						  		</c:otherwise>
						  	</c:choose>
						  	<c:choose>
						  		<c:when test="${page.pageNum == 1 }">
						  			<li><a>Prev</a></li>
						  		</c:when>
						  		<c:otherwise>
								  	<li><a href="document.jspx?p=${page.pageNum -1}">Prev</a></li>
						  		</c:otherwise>
						  	</c:choose>
						  	<c:choose>
						  		<c:when test="${page.pageNum == page.totalPages}">
						  			<li><a>Next</a></li>
						  		</c:when>
						  		<c:otherwise>
								  	<li><a href="document.jspx?p=${page.pageNum+1}">Next</a></li>
						  		</c:otherwise>
						  	</c:choose>
						  	<c:choose>
						  		<c:when test="${page.pageNum == page.totalPages }">
						  			<li><a>尾页</a></li>
						  		</c:when>
						  		<c:otherwise>
								  	<li><a href="document.jspx?p=${page.totalPages}">尾页</a></li>
						  		</c:otherwise>
						  	</c:choose>
						</ul>
					</div>
						</c:otherwise>
					</c:choose>
				
					
				</div>																				
			</div>
		</div>
	</div>
  </body>
</html>
